package com.hundunjiang.admin.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.stp.StpUtil;
import com.hundunjiang.modules.system.entity.SysAdmin;
import com.hundunjiang.modules.system.service.SysAdminService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@Tag(name = "后台-系统管理-用户管理")
@RequestMapping("/admin/system/user")
@RestController
@SaCheckPermission(value = "sys.admin", orRole = "admin")
public class SysAdminController {

    @Resource
    private SysAdminService sysAdminService;

    @SaCheckPermission(value = "sys.admin*add", orRole = "admin")
    @Operation(summary = "后台用户添加", description = "后台用户添加")
    @RequestMapping(path = "/add", method = RequestMethod.POST)
    public String add(@RequestBody SysAdmin sysAdmin) {
        sysAdminService.addUser(sysAdmin);
        return  null;

    }
}